package demo.task;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class ScheduledJob {

    private Logger logger = LoggerFactory.getLogger(ScheduledJob.class);

    @Scheduled(cron = "0 0/1 * * * ?")
    public void job1() {
        logger.info("cron task :{}", "job1");
    }

    @Scheduled(cron = "0 0/2 * * * ?")
    public void job2() {
        logger.info("cron task :{}", "job2");
    }

    @Scheduled(fixedRate = 90_000)
    public void job3() {
        logger.info("fixedRate task:{}", "job3");
    }

}
